package com.tsing.cli.system.constant;

/**
 * 认证授权相关常量类
 *
 * @author TheTsing
 */
public class AuthConstants {

    /**
     * redis存储token的key的前缀，key格式示例：token_123_eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9...
     */
    public static final String REDIS_TOKEN_PREFIX = "token_";

    /**
     * 请求头携带鉴权信息的key
     */
    public static final String AUTHENTICATION_HEAD = "Authorization";

    /**
     * token前缀
     */
    public static final String TOKEN_PREFIX = "Bearer ";

    /**
     * 用户默认密码
     */
    public static final String DEFAULT_PASSWORD = "123456";

    /**
     * redis存储用户登录失败次数的key的前缀
     */
    public static final String REDIS_LOGIN_COUNT_PREFIX = "login_count_";

    /**
     * redis存储用户登录失败次数的key的过期时间
     */
    public static final long LOGIN_COUNT_EXPIRE = 900L;

    /**
     * 用户登录失败次数最大限制
     */
    public static final int LIMIT_LOGIN_ACCOUNT = 5;

}
